package com.mrinalwadhwa.effects.zoomblur
{
	import com.mrinalwadhwa.effects.BendPixels;
	import flash.utils.ByteArray;
	import mx.effects.IEffectInstance;
	
	public class ZoomBlurEffect extends BendPixels{

		[Embed("zoomBlur.pbj", mimeType="application/octet-stream")]
		private var ZoomBlurFilter:Class;

		public static const MIN_AMOUNT:Number = 0; 
		public static const MAX_AMOUNT:Number = 5; 
		public static const DEFAULT_AMOUNT:Number = 0; 

		public static const MIN_CENTERX:Number = 0; 
		public static const MAX_CENTERX:Number = 2048; 
		public static const DEFAULT_CENTERX:Number = 150; 

		public static const MIN_CENTERY:Number = 0; 
		public static const MAX_CENTERY:Number = 2048; 
		public static const DEFAULT_CENTERY:Number = 150; 


		[Inspectable(category="General")]
		public var fromAmount:Number = DEFAULT_AMOUNT;
		
		[Inspectable(category="General")]
		public var toAmount:Number = DEFAULT_AMOUNT;

		[Inspectable(category="General")]
		public var fromCenterX:Number = DEFAULT_CENTERX;
		
		[Inspectable(category="General")]
		public var toCenterX:Number = DEFAULT_CENTERX;

		[Inspectable(category="General")]
		public var fromCenterY:Number = DEFAULT_CENTERY;
		
		[Inspectable(category="General")]
		public var toCenterY:Number = DEFAULT_CENTERY;



		public function ZoomBlurEffect(target:Object=null){
			super(target);
		}
		
        override protected function initInstance(inst:IEffectInstance):void {
			benderByteArray = new ZoomBlurFilter() as ByteArray
			benderParams = [
							['amount',fromAmount,toAmount],
							['center',[fromCenterX, fromCenterY],[toCenterX,toCenterY]],							
						   ];	
            super.initInstance(inst);
        } 		

	}
}